<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<%

	String actionname = request.getParameter("action");
	if(actionname!=null && actionname.equals("login")){
		String username= request.getParameter("username");
		String password= request.getParameter("password");
		if("admin".equals(username) && "admin".equals(password) ){
			session.setAttribute("admin","true");
			response.sendRedirect("index.jsp");
		}
	}

 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登陆</title>
</head>
<body>


	<form action="login.jsp" method="post" name="loginform">
	
		<input type="hidden" name="action" value="login">
		
		
		<table align="center">
			<tr>
				<td>
					用户名
				</td>
				<td>
					<input type="text" size="15" maxlength="15" name="username">
				</td>
			</tr>
		
			<tr>
				<td>
				密码
				</td>
				<td>
					<input type="password" size="15" maxlength="15" name="password">
				</td>
			</tr>
		
			<tr align="center">
				<td colspan="2">
					<input type="submit"  value="登陆">
					<input type="reset"  value="重置">
				</td>
			</tr>
		
		
		</table>
	</form>
</body>
</html>